package com.itaming.lycheeframework.support.config;

import com.itaming.lycheeframework.support.utils.SpringUtil;
import org.springframework.beans.BeansException;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.lang.NonNull;

/**
 * Support模块配置类
 *
 * @author A.Ming
 */
@AutoConfiguration
public class LycheeSupportConfiguration implements ApplicationContextAware {

    /**
     * 注入ApplicationContext
     *
     * @param applicationContext ApplicationContext
     * @throws BeansException
     */
    @Override
    public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException {
        SpringUtil.ContextHolder.setApplicationContext(applicationContext);
    }

}
